<?php
include('confdb.php');

$sud = $_POST['sud'] ?? '';
$idconn = $_POST['ids'] ?? '';

$con = mysqli_connect($db_host, $db_user, $db_pass, $db_name);

if(!$con) {

die ('Ошибка подключения: '.mysqli_connect_error());

} 

$otvet= array();

$query = "INSERT INTO connect_judges (connect_idconnect, number_judges) VALUES ('$idconn', '$sud')";

$result = mysqli_query($con, $query);

if($result){
    $otvet['success']=1;
    
} else { $otvet['success']=0; }

    echo json_encode($otvet);
    
?>